﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using COM.Web;
using WebApp.Web.Service;

namespace WebApp.Web
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class JuZhongApplication : COM.Web.MvcWebApplication
    {
        protected override void Application_Start()
        {
            COM.Service.FileLogService.Instance.ClearLog();
            //RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);//测试mvc
            COM.Web.WebStartService.Instance.Start();
            RouteTable.Routes.RouteExistingFiles = false;
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleTable.EnableOptimizations = true;
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            AreaRegistration.RegisterAllAreas();
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new CustomerRazorViewEngine()); //注册自定义视图
            var configService = Unity.Instance.GetService<COM.Service.IConfigService>();
            WebApp.Web.Service.AppStartService.Instance.Start();
        }


    }
}